package thread;


import com.sun.corba.se.impl.orb.ParserTable;
import oo_day03.Test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class SleepDemo {
    public static void main(String[] args) throws IOException {
        System.out.println("开始");

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //低级流，从控制台上读取内容
        String line = br.readLine();//读取一行字符串
        int num = Integer.parseInt(line); //将字符串转换为整数
        for (; num > 0; num--) {
            System.out.println(num);
        }try {
            Thread.sleep(5000); //主线程执行时会堵塞5秒
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        br.close();
        System.out.println("结束");
    }
}
